<agenttpl file="user_center_header" />
<script src="__PUBLIC__js/subagent.js"></script>

<section>
    <div class="user_center main">
        <div class="banner_1">
            <img src="__PUBLIC__img/1200-200+.jpg" alt=""/>
        </div>
        <div class="user_center_main page-content">
            <agenttpl file="share/side" />
            <div class="page-right my-game query-records lower-channel-management">
                <form id="queryForm" action="#" method="post">
                    <input id="currentNo_queryForm" name="currentNo" type="hidden" value="1">
                    <input id="pageSize_queryForm" name="pageSize" type="hidden" value="10">
                    <div class="input-content">
                        <div class="search-game search-channel">
                            <span>搜索代理：</span>
                            <input name="key" type="text" value="" maxlength="25" placeholder="请输入代理ID或代理名称">
                        </div>
                        <div class="search-btn" id="search-btn" onclick="$('#currentNo_queryForm').val(1); $('#queryForm').submit();">搜&nbsp;索</div>
                        <!--跳转到新增下级代理页面-->
                        <div class="search-btn export-excel add-btn" onclick="location.href ='{:U('Agent/Ucenter/addSub')}'">新&nbsp;增</div>
                    </div>
                </form>
                <div class="search-results">

                    <div class="results-header">
                        <span class="game-num">共找到<i>{$count}</i>个代理</span>
                       
                    </div>
                    <div class="table-content">
                        <table border="0" cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <th width="80">代理ID</th>
                                    <th width="110">代理名称</th>
                                    <th width="110">真实姓名</th>
                                    <th width="100">{:C(CURRENCY_NAME)}余额（元）</th>
                                    <th width="130">创建时间</th>

                                    <th width="80">状态</th>
                                    <th width="80">操作</th>
                                </tr>

                                <volist name="items" id="vo">
                                    <tr class="even">
                                        <td>{$vo.id}</td>
                                        <td>{$vo.user_login}</td>
                                        <td>{$vo.user_nicename}</td>
                                        <td>0.00</td>
                                        <td>{$vo.create_time}</td>
                                        <td>
                                            <switch name="vo.user_status">
                                                <case value="2">正常</case>
                                                <case value="3">禁用</case>
                                            </switch>
                                        </td>
                                        <td>
                                            <a href="{:U('Agent/ucenter/editSub')}/{$vo.id}" target="_self" class="edit_a" style="cursor:pointer;color:#00a0e9;">修改</a>
                                            &nbsp;&nbsp;
                                            <a href="javascript:;" onclick="delsub('{$vo.id}','{$vo.user_nicename}');" class="del_a" style="cursor:pointer;">删除</a>
                                        </td>
                                        
                                    </tr>
                                </volist>                           
                            </tbody>
                        </table>

                        <div class="page" style="">
                            <span class="game-num">
                                共为您找到 {$count} 个代理
                            </span>
                            <div class="paging">
                               {$page}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</section>

<style>
.del_a{
    color:red;
}
.del_a:hover{
    color:red;
}
</style>
<script>
function delsub(subid,uname){

    var con=confirm("真的要删除下级代理 【"+uname+"】 吗？");

    if(!con){
       return; 
    }
    $.post("{:U('Agent/ucenter/delSub')}",{"subid":subid},function(data){
        if(data.error==='0'){
            location.reload();
        }else{
            yxalert(data.msg);
        }
    });
}
</script>

<agenttpl file="user_center_footer" />